package cn.webrx;


import java.util.Calendar;

public class Ex10 {
    public static void main(String[] args) {
        Calendar c = Calendar.getInstance();
        c.set(2022, 1, 1, 0, 0, 0);
        System.out.printf("%tF %<tT %n", c);
        var s = c.getTimeInMillis();
        var e = System.currentTimeMillis();
        long time = Math.round(Math.random() * (e - s) + s);
        System.out.printf("%tF %<tT %n", time);
        System.out.printf("相差的天数为: %d天", (e - s) / 1000 / 60 / 60 / 24);


    }
}
